﻿using System;
using System.Data.Entity;
using Icms.Core.Model;
using Icms.Core.Repository;

namespace Icms.Data
{
    public class ReadRepo<T> : IReadRepo<T> where T : Entity
    {
        protected readonly DbContext c;

        public ReadRepo(IDbrContextFactory f)
        {
            c = f.GetContext();
        }

        public T Get(Guid id)
        {
            return c.Set<T>().Find(id);
        }
    }
}